From: Colin Walters Date: Mon, 21 Aug 2023 21:11:32 +0000 (-0400) Subject: prepare-root: Init composefs options earlier X-Git-Tag: archive/raspbian/2023.7-3+rpi1^2~16^2^2~40^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=1d316e31093e33eff6c3ae7f8081547ef93e72ed;p=ostree.git prepare-root: Init composefs options earlier Prep for a later patch. --- diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 50ea0e92..682e71ea 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -436,6 +436,11 @@ main (int argc, char *argv[]) 1, }; + cfs_options.flags = LCFS_MOUNT_FLAGS_READONLY; + cfs_options.image_mountdir = OSTREE_COMPOSEFS_LOWERMNT; + if (mkdirat (AT_FDCWD, OSTREE_COMPOSEFS_LOWERMNT, 0700) < 0) + err (EXIT_FAILURE, "Failed to create %s", OSTREE_COMPOSEFS_LOWERMNT); + g_autofree char *expected_digest = NULL; if (composefs_config->is_signed) @@ -476,11 +481,6 @@ main (int argc, char *argv[]) ot_bin2hex (expected_digest, cfs_digest_buf, g_variant_get_size (cfs_digest_v)); } - cfs_options.flags = LCFS_MOUNT_FLAGS_READONLY; - cfs_options.image_mountdir = OSTREE_COMPOSEFS_LOWERMNT; - if (mkdirat (AT_FDCWD, OSTREE_COMPOSEFS_LOWERMNT, 0700) < 0) - err (EXIT_FAILURE, "Failed to create %s", OSTREE_COMPOSEFS_LOWERMNT); - if (expected_digest != NULL) { cfs_options.flags |= LCFS_MOUNT_FLAGS_REQUIRE_VERITY;